﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Meqs.Entity
{
    /// <summary>
    /// 检查单
    /// </summary>
    [Serializable]
    public class EvalSheets
    {
        private int _rID;
        private int _destID;
        private int _templateID;
        private string _sheetName;
        private DateTime _evalDate;
        private double _score;
        private short _dirty;
        private short _studentEval;
        private int _seID;
        private int _creator;

        public EvalSheets()
        {
            _score = 0;
            _dirty = 0;
            _studentEval = 0;
        }

        public EvalSheets(int rID, int destID, int templateID, string sheetName, DateTime evalDate, double score, short dirty, short studentEval, int seID, int creator)
        {
            _rID = rID;
            _destID = destID;
            _templateID = templateID;
            _sheetName = sheetName;
            _evalDate = evalDate;
            _score = score;
            _dirty = dirty;
            _studentEval = studentEval;
            _seID = seID;
            _creator = creator;
        }

        /// <summary>
        /// ID
        /// </summary>
        public int RID
        {
            get { return _rID; }
            set { _rID = value; }
        }

        /// <summary>
        /// 被评教师ID
        /// </summary>
        public int DestID
        {
            get { return _destID; }
            set { _destID = value; }
        }

        /// <summary>
        /// 使用样表ID
        /// </summary>
        public int TemplateID
        {
            get { return _templateID; }
            set { _templateID = value; }
        }

        /// <summary>
        /// 检查单名称
        /// </summary>
        public string SheetName
        {
            get { return _sheetName; }
            set { _sheetName = value; }
        }

        /// <summary>
        /// 检查单日期
        /// </summary>
        public DateTime EvalDate
        {
            get { return _evalDate; }
            set { _evalDate = value; }
        }

        /// <summary>
        /// 分数
        /// </summary>
        public double Score
        {
            get { return _score; }
            set { _score = value; }
        }

        /// <summary>
        /// 是否需要重新计算
        /// </summary>
        public short Dirty
        {
            get { return _dirty; }
            set { _dirty = value; }
        }

        /// <summary>
        /// 是否学生评教
        /// </summary>
        public short StudentEval
        {
            get { return _studentEval; }
            set { _studentEval = value; }
        }

        /// <summary>
        /// 学生评教活动ID
        /// </summary>
        public int SeID
        {
            get { return _seID; }
            set { _seID = value; }
        }

        /// <summary>
        /// 创建人ID
        /// </summary>
        public int Creator
        {
            get { return _creator; }
            set { _creator = value; }
        }

        public bool Equals(EvalSheets other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other._rID == _rID;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof(EvalSheets)) return false;
            return Equals((EvalSheets)obj);
        }

        public override int GetHashCode()
        {
            return _rID;
        }
    }
}
